package com.xiao.ztree.sys.controller;


import com.xiao.ztree.core.R;
import com.xiao.ztree.sys.entity.User;
import com.xiao.ztree.sys.service.IUserService;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author XiaoCoder
 * @since 2021-04-30
 */
@RestController
@AllArgsConstructor
@RequestMapping("/user")
public class UserController {

    private final IUserService iUserService;

    /**
     * 用户登录
     *
     * @param user
     * @return
     */
    @ApiOperation(value = "根据id获取文章数据",
            notes = "根据id获取文章数据")
    @PostMapping("/login")
    public R login(@RequestBody User user) {
        return R.ok(iUserService.login(user));
    }

}
